package com.crm.model.mdao;

import java.util.List;
import java.util.Map;

import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import com.crm.model.mpojo.Users;

@Mapper
public interface UserMapper {

	/**
	 * 查询所有用户
	 */
	public List<Map<String, String>> selectUserAll();

	/**
	 * 查询某部门所有员工
	 */
	public List<Map<String, String>> selectWorkerAll(@Param("dept") Integer deptId);

	/**
	 * 查询所有用户名
	 * 
	 * @return
	 */
	public List<String> selectAllUsername();

	/**
	 * 根据用户名查询
	 * 
	 * @param uaserName
	 * @return
	 */
	public Users findByUsername(@Param("name") String userName);

	int deleteByPrimaryKey(Integer uId);

	int insert(Users record);

	int insertSelective(Users record);

	Users selectByPrimaryKey(Integer uId);

	int updateByPrimaryKeySelective(Users record);

	int updateByPrimaryKey(Users record);
	
	List<Map<String, String>> selectAllTable(@Param("deptId") Integer deptId,@Param("search") String search);
	
	Map<String, String> selectAllView(Integer uId);
}
